package com.gitee.zw.irmp.common.auth.session;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
@ConditionalOnProperty(value = "app.irmp.common.auth.session-type", havingValue = "memory", matchIfMissing = false)
public class MemorySessionConfig {
    @Bean
    @ConditionalOnMissingBean(UserSessionStore.class)
    public UserSessionStore userSessionStore() {
        log.info("UserSessionStore is memory");
        return new UserSessionStoreMemImpl();
    }
}
